package mina

import (
	"bgs/cache/redisImp"
	"bgs/conf"
	"bgs/db"
	"fmt"

	"go.uber.org/zap"
)

// MinaServiceImp brand bizlogic
type MinaServiceImp struct {
	dao        *db.PgDao
	slog       *zap.SugaredLogger
	wechatVars *conf.WechatSection
	vars       *conf.VarsSection
	cacher     *cache.Adapter
}

// NewMinaService initialization
func NewMinaService(
	pgdao *db.PgDao,
	slog *zap.SugaredLogger,
	wechatVars *conf.WechatSection,
	vars *conf.VarsSection,
	adp *cache.Adapter,
) *MinaServiceImp {
	return &MinaServiceImp{
		dao:        pgdao,
		slog:       slog.With("module", "wxpMinaService"),
		wechatVars: wechatVars,
		vars:       vars,
		cacher:     adp,
	}
}

func (s *MinaServiceImp) getURL (urlFragment string) string {
	return fmt.Sprintf("https://api.weixin.qq.com/cgi-bin%s", urlFragment)
}